﻿#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
	int num, j, k, temp, n, c = 0;
	int arry[20];
	printf("input:");
	for (;;)
	{
		scanf("%d", &num);
		if (num == -1)
			break;
		if (num > 0)
		{
			arry[c] = num;
			c = c++;
		}
	}
	for (j = 1; j <= c-1 ; j++)
	{
		for (k = 1; k <= c - j; k++)
		{
			if (arry[k-1] > arry[k])
			{
				temp = arry[k-1];
				arry[k-1] = arry[k];
				arry[k] = temp;
			}
		}
	}
	printf("Output:\n");
	for (n = 0; n < c; n++)
	{
		printf("%d ", arry[n]);

	}
	printf("\n");
	return 0;
}
